package c.c.k.config;

import cn.hutool.core.io.FileUtil;
import lombok.Data;
import org.springframework.context.annotation.Configuration;

import java.io.File;

@Data
@Configuration
public class StockConfig {
    private static final String LICENCE_PATH = File.separator.equals("/")  ? "/etc/licence.txt" : "d:\\licence.txt" ;
    private String licence;

    public StockConfig(){
        licence = "310A1039-25C1-A65F-D8BA-B3003E813044";
    }

    public String getBaseUrl() {
        return  "https://ig507.com/data/base/gplist?licence=" + licence;
    }

    public String getBaseUrlHK() {
        return  "https://out.ig507.com/data/base/gplisthk?licence= " + licence;
    }

    public String getTradeNowUrl() {
        return  "https://ig507.com/data/time/real/%s?licence=" + licence;
    }

    public String getTradeNowUrlHK() {
        return  "https://out.ig507.com/data/time/hk/real/%s?licence=" + licence;
    }

    public String getTradeHistoryUrl(){
        return "https://ig507.com/data/time/history/trade/%s/Day?licence=" + licence;
    }

    public String getTradeHistoryUrlHK(){
        return "https://out.ig507.com/data/time/hk/history/trade/%s/Day?licence=" + licence;
    }

    public String getFundUrl(){
        return "https://ig507.com/data/base/jjdm?licence=" + licence;
    }


    public String getFundStockUrl(){
        return "https://ig507.com/data/time/jjf10/tzzh/jjcc/%s?licence=" + licence;
    }
}
